<div class="row m-n">
    <div class="crumbs-bar">
        <div yb-crumbs></div>
    </div>
    <div tabset type="tab">
        <div tab heading="代理商各品类采购情况（出库）" active="activeFlag[0]">
            <div class="row wrapper-y-sm">
                <div class="search-bar wrapper-none col-xs-12">
                    <div class="btn-group m-l-xs pull-right">
                        <button type="button" class="btn btn-default base-color" ng-click="search(1)" title="刷新">
                            <i class="yb-icon ico-refresh"></i>
                        </button>
                        <div class="btn btn-default base-color" ng-if="!!btnPermission.agentProductCateExport">
                            <div title="导出" yb-download download-url="exportParam.url" download-param="condition">
                                <i class="yb-icon ico-export-o"></i>
                            </div>
                        </div>
                    </div>
                    <button class="btn-advance pull-right m-l-xs" ng-click="switchToolbar('showAgentAdSearch')">高级搜索</button>
                    <div class="input-group pull-right clearfix">
                        <input type="text" class="form-control txt-search" placeholder="代理商"
                               ng-model="condition.agentName">
                        <span class="input-group-addon cursor-pointer" ng-click="search(1)">搜索</span>
                    </div>
                    <div class="wrapper-none search-bar-data-picker pull-right">
                        <div class="normal-search clearfix">
                            <label class="control-label"><i>*</i>开始时间：</label>
                            <input type="text" class="form-control date-picker m-r-sm" ng-model="condition.startCreateDate"
                                   datepicker-popup="yyyy-MM-dd"
                                   ng-click="switchDataPicker(0)" placeholder="必填"
                                   ng-change="checkDate(condition, 'startCreateDate', 'endCreateDate')"
                                   is-open="datePickerFlag[0]" close-text="关闭" readonly>
                            <label class="control-label"><i>*</i>结束时间：</label>
                            <input type="text" class="form-control date-picker m-r-sm" ng-model="condition.endCreateDate"
                                   datepicker-popup="yyyy-MM-dd"
                                   ng-click="switchDataPicker(1)" placeholder="必填"
                                   ng-change="checkDate(condition, 'startCreateDate', 'endCreateDate')"
                                   is-open="datePickerFlag[1]" close-text="关闭" readonly>
                        </div>
                    </div>
                </div>
                <div yb-advance-search show-toolbar="toolbarConfig.showAgentAdSearch" search-data="confirmSearch()" reset-data="reset()">
                    <div class="advance-search m-t-sm">
                        <div class="form-group clearfix">
                            <label class="control-label">分类：</label>
                            <div check-box-selector ng-model="selectClassInfo.selectClassesStr" value-list="tbConf.searchTableCol" box-click="selectClass()"
                                 default-value="请选择分类" class="col-xs-7 wrapper-none dropdown-prop"></div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="main-area">
                <div yb-table-fixed class="table-fixed-wrap">
                    <div class="th-scroll-x" ng-style="tbStyle.scrollLeft" style="height:82px;">
                        <table class="table-fixed border-none" width="{{tbConf.scrollWidth}}">
                            <thead>
                                <tr>
                                    <th width="160" rowspan="2" class="text-center th-check">
                                        代理商
                                    </th>
                                    <th class="text-center th-check" ng-repeat="item in tbConf.tableTopHead track by $index" width="{{item.width}}" colspan="{{item.colSpan}}">
                                        {{item.name}}
                                    </th>
                                </tr>
                                <tr>
                                    <th ng-repeat="itemCol in tbConf.tableCol track by $index" class="text-center th-check border-top"
                                        width="{{itemCol.width}}" ng-click="toSort(tbConf.tableCol, $index)"
                                        ng-show="!!itemCol.isShow && !itemCol.isFixed">
                                        <div yb-thead-operate ng-model="itemCol" target-width="tbConf.scrollWidth"></div>
                                    </th>
                                    <th width="120" class="text-center th-check border-top" ng-if="tbConf.tableCol.length > 0">
                                        小计
                                    </th>
                                </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="td-scroll" ng-show="dataList.length > 0" ng-style="tbStyle.scrollLeft" style="top:82px">
                        <table class="table-fixed border-none" width="{{tbConf.scrollWidth}}">
                            <tbody>
                            <tr ng-repeat="item in dataList track by $index">
                                <td width="160" class="text-center spill-dots" title="{{item.agentName}}">
                                   <span>{{item.agentName}}</span>
                                </td>
                                <td class="text-center spill-dots" ng-repeat="itemCol in tbConf.tableCol track by $index"
                                    width="{{itemCol.width}}" ng-show="!!itemCol.isShow && !itemCol.isFixed">
                                    <span ng-repeat="class in item.classAmountList" ng-if="class.className == itemCol.name"
                                          title="{{class.outAmount}}">
                                        {{class.outAmount}}
                                    </span>
                                </td>
                                <td width="120" class="text-center spill-dots">
                                    <span>{{item.subtotal}}</span>
                                </td>
                            </tr>
                            <tr ng-if="totalRow" ng-repeat="item in totalRow" class="yellow-bg">
                                <td width="160" class="text-center spill-dots" title="{{item.agentName}}">
                                    <span>{{item.agentName}}</span>
                                </td>
                                <td class="text-center spill-dots" ng-repeat="itemCol in tbConf.tableCol track by $index"
                                    width="{{itemCol.width}}" ng-show="!!itemCol.isShow && !itemCol.isFixed">
                                    <span ng-repeat="class in item.classAmountList" ng-if="class.className == itemCol.name"
                                          title="{{class.outAmount}}">
                                        {{class.outAmount}}
                                    </span>
                                </td>
                                <td width="120" class="text-center spill-dots">
                                    <span>{{item.subtotal}}</span>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="no-data w-full text-center p-t" ng-show="dataList.length === 0" style="top:82px">暂时没有数据</div>
                </div>
            </div>
            <div class="bottom-area page-bar wrapper-y-sm clearfix">
                <div yb-page-info ng-model="pageInfo" yb-refresh="search()"></div>
            </div>
        </div>
    </div>
</div>
